#!/bin/bash

# Exercise week 6
# Author: Michael Joergler
# Date: 22.10.2013
# Version: 1.0

FREQ=$1
DUR=$2
NAME=$3

#calculate how many measures have to be taken
NRCOLL=$((DUR/FREQ))

echo "Script started. Please wait!"
mpstat $FREQ $NRCOLL >> temp.dat
gzip temp.dat
mv temp.dat.gz $(pwd)/$NAME
echo "Script is finished"